package com.grass.p019lv.novel.viewmodel;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;
import com.androidx.p013lv.base.bean.UserInfo;
import com.androidx.p013lv.base.http.BaseRes;
import com.androidx.p013lv.base.http.HttpUtils;
import com.androidx.p013lv.base.http.JsonParams;
import com.androidx.p013lv.base.http.UrlManager;
import com.androidx.p013lv.base.http.callback.HttpCallback;
import com.androidx.p013lv.base.utils.SpUtils;
import com.grass.p019lv.bean.MessageDynamicLike;

/* renamed from: com.grass.lv.novel.viewmodel.VoiceNovelModel */
public class VoiceNovelModel extends ViewModel {
    private MutableLiveData<BaseRes<MessageDynamicLike>> dynamicLikeLive;

    public MutableLiveData<BaseRes<MessageDynamicLike>> getDynamicLikeLive() {
        if (this.dynamicLikeLive == null) {
            this.dynamicLikeLive = new MutableLiveData<>();
        }
        return this.dynamicLikeLive;
    }

    public void getUserInfo() {
        HttpUtils.getInsatance().post(UrlManager.getInsatance().userInfo(), JsonParams.build().commit(), new HttpCallback<BaseRes<UserInfo>>("userInfo") {
            /* class com.grass.p019lv.novel.viewmodel.VoiceNovelModel.C32201 */

            public void onLvSuccess(BaseRes<UserInfo> baseRes) {
                if (baseRes.getCode() == 200) {
                    SpUtils.getInstance().setUserInfo(baseRes.getData());
                }
            }
        });
    }

    public void cancelHttp() {
        HttpUtils.getInsatance().cancelTag("userInfo");
    }
}
